package com.itestor.iptv.modules.ne.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 丢包率
 * @author masaki
 */
@Entity
@Table(name = "iptvlostrate")
public class IptvLostRate {
	/**
	 * 主键ID
	 */
	private Long idIptvLostRate;
	/**
	 * 设备ID
	 */
	private Long idRobot;
	/**
	 * 记录时间
	 */
	private Long logTime;
	/**
	 * 错误次数
	 */
	private Long errorCount;
	/**
	 * 总共次数
	 */
	private Long tatolCount;
	/**
	 * @return idIptvQuality
	 */
	@Id
	@GeneratedValue
	@Column(name = "idIptvLostRate" , length = 11)
	public Long getIdIptvLostRate() {
		return idIptvLostRate;
	}
	/**
	 * @return idRobot
	 */
	@Column(name = "idRobot" , length = 11 , nullable = false)
	public Long getIdRobot() {
		return idRobot;
	}
	/**
	 * @return logTime
	 */
	@Column(name = "LogTime" , length = 11 , nullable = false)
	public Long getLogTime() {
		return logTime;
	}
	/**
	 * @return errorCount
	 */
	@Column(name = "ErrorCount" , length = 11 , nullable = false)
	public Long getErrorCount() {
		return errorCount;
	}
	/**
	 * @return tatolCount
	 */
	@Column(name = "TatolCount" , length = 11 , nullable = false)
	public Long getTatolCount() {
		return tatolCount;
	}
	/**
	 * @param idIptvQuality
	 */
	public void setIdIptvLostRate(Long idIptvLostRate) {
		this.idIptvLostRate = idIptvLostRate;
	}
	/**
	 * @param idRobot
	 */
	public void setIdRobot(Long idRobot) {
		this.idRobot = idRobot;
	}
	/**
	 * @param logTime
	 */
	public void setLogTime(Long logTime) {
		this.logTime = logTime;
	}
	/**
	 * @param errorCount
	 */
	public void setErrorCount(Long errorCount) {
		this.errorCount = errorCount;
	}
	/**
	 * @param tatolCount
	 */
	public void setTatolCount(Long tatolCount) {
		this.tatolCount = tatolCount;
	}
	
	/**
	 * 
	 * @return
	 */
	@Transient
	public double getIptvLostRateStr(){
	    return this.errorCount/this.tatolCount;
	}
	
}
